﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'EstacionGetList')
	BEGIN
		DROP  Procedure  EstacionGetList
	END
GO

CREATE PROCEDURE EstacionGetList
	(	
		@empresaId AS INT,
		@sucursalId AS INT,				
		@filtro AS VARCHAR(50) = NULL
	)	
AS
BEGIN	
	SET NOCOUNT ON
	
	SELECT	EstacionId AS Id, Nombre, ImpresoraFacturas, ImpresoraDevoluciones, ImpresoraTiquetes, 
			ConsecutivoFactura, ConsecutivoDevolucion
	FROM Estacion
	WHERE EmpresaId = @empresaId	  
	  AND SucursalId = @sucursalId
	  AND Nombre like '%' + ISNULL(@filtro,'') + '%'
	  AND Activo = 1 

	SET NOCOUNT OFF
END
GO

  